package com.sangeng.constant.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误"),
    CONTENT_NOT_NULL(506, "内容不能为空"),
    FILE_UPLOAD_ERROR(509, "文件上传失败"),
    FILE_TOO_LARGE(510, "文件太大"),
    FILE_TYPE_ERROR(511, "文件类型错误"),
    UPDATE_USER_ERROR(507, "更新信息失败"),
    PARAM_INVALID(508, "用户注册信息不完整"),
    INSERT_ERROR(512, "新增失败"),
    DELETE_ERROR(513, "删除失败"),
    UPDATE_ERROR(514, "更新失败"),
    GET_ERROR(515, "查询失败"),
    CATEGORY_NAME_EXIST(516, "分类已存在");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}